package com.yonyou.gmmc.service.customer.service;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yonyou.gmmc.service.customer.dao.TtWebpageLogMapper;
import com.yonyou.gmmc.service.customer.entity.TtWebpageLog;
import com.yonyou.gmmc.service.customer.entity.WebpageLogPo;

@Transactional
@Service("WebpageLogService")
public class WebpageLogService {

	@Autowired
	TtWebpageLogMapper ttWebpageLogMapper;

	public int addWebpageLog(List<TtWebpageLog> list) throws Exception {
		return ttWebpageLogMapper.insertWebpageLog(list);
	}

	public PageInfo<WebpageLogPo> getWebpagLog(Map<String, Object> paramMap) {
		PageHelper.startPage(Integer.parseInt(paramMap.get("pageNum").toString()),
				Integer.parseInt(paramMap.get("pageSize").toString()));

		List<WebpageLogPo> webLogList = ttWebpageLogMapper.selectWebpageLog(paramMap);
		PageInfo<WebpageLogPo> page = new PageInfo<WebpageLogPo>(webLogList);
		return page;
	}

}
